
package de.swta.freezay.components;

import de.swta.freezay.database.dbEntities.Category;
import org.apache.wicket.markup.html.form.IChoiceRenderer;

/**
 * Special IChoiceRenderer for category entities
 *
 * @author Jan Korreck
 * @see IChoiceRenderer
 */
public class CategoryChoiceRenderer implements IChoiceRenderer<Category> {

    @Override
    public Object getDisplayValue(Category cat) {
        return "" + cat.getName();
    }

    @Override
    public String getIdValue(Category cat, int listIndex) {
        return "" + cat.getId();
    }

}
